package com.yss.sofa.report.engine.cell;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

import com.yss.sofa.report.engine.Const;

public class FloatingCell extends ReportCell{
	private static final long serialVersionUID = 5968574549081045386L;
	private String from;
	private String clazz;
	private String visible;
	private Set<String> params=new HashSet<String>();
	private Map<String,String> position=new HashMap<String,String>();
	private Map<String,Integer> pos=new HashMap<String,Integer>();
	protected void init() {
		super.init();
		this.type=Const.REPORT_CELL_TYPE_FLOATING;
		this.visible="true";
	}
	public void assignTo(ReportCell cell){
		FloatingCell _=(FloatingCell)cell;
		super.assignTo(_);
		_.from=this.from;
		_.clazz=this.clazz;
		_.visible=this.visible;
		_.position.clear();
		_.position.putAll(this.position);
		_.pos.clear();
		_.pos.putAll(this.pos);
		_.params.clear();
		_.params.addAll(this.params);
	}
	public FloatingCell create(){
		FloatingCell _=new FloatingCell();
		this.assignTo(_);
		return _;
	}
	public String getClazz() {
		return clazz;
	}
	public void setClazz(String clazz) {
		this.clazz = clazz;
	}
	public Map<String,String> getPosition() {
		return position;
	}
	public void setPosition(Map<String,String> position) {
		this.position = position;
	}
	public Map<String,Integer> getPos() {
		return pos;
	}
	public int getLeft(){
		return pos.get("left");
	}
	public int getTop(){
		return pos.get("top");
	}
	public int getRight(){
		return pos.get("right");
	}
	public int getBottom(){
		return pos.get("bottom");
	}
	public String getFrom() {
		return from;
	}
	public void setFrom(String from) {
		this.from = from;
	}
	public Set<String> getParams() {
		return params;
	}
	public void setParams(Set<String> params) {
		this.params = params;
	}
	public String getVisible() {
		return visible;
	}
	public void setVisible(String visible) {
		this.visible = visible;
	}
}
